Command = require '../../command'
Protocol = require '../../protocol'

class LocalCommand extends Command
  execute: (path) ->
    this._send if /:/.test(path) then path else "localfilesystem:#{path}"
    @parser.readAscii 4
      .then (reply) =>
        switch reply
          when Protocol.OKAY
            @parser.raw()
          when Protocol.FAIL
            @parser.readError()
          else
            @parser.unexpected reply, 'OKAY or FAIL'

module.exports = LocalCommand
